<?php

namespace App\Http\Controllers\Admin;

use App\Http\Models\Course;
use App\Http\Models\Lession;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class LessionController extends Controller
{
    public function lst()
    {
        $size = 2;
        $lessionData = Lession::paginate($size);
        $lessionData->each(function($lession){
            $lession->course = Course::find($lession->course_id);
        });
        return view('admin.lession.lst', compact('lessionData'));

    }

    public function show(Request $request, $id)
    {
        // 查询当前要播放的视频信息
        $info = Lession::find($id);
        return view('admin.lession.show', compact('info'));
    }
}
